package com.lefeng.cockpit.common.bean.po.executor;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by weifw
 */
@Data
@ApiModel
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "dc_datax_executor", autoResultMap = true)
public class ExecutorPO {

    @TableId
    @ApiModelProperty("执行器Id")
    private Integer id;

    @ApiModelProperty("执行器AppName")
    private String appName;

    @ApiModelProperty("执行器名称")
    private String title;

    @ApiModelProperty("执行器地址类型：0=自动注册、1=手动录入")
    private int addressType;

    @ApiModelProperty("执行器地址列表，多地址逗号分隔(手动录入)")
    private String addressList;

    @ApiModelProperty("Executor状态")
    private int status;

    public List<String> getRegistryList() {
        return new ArrayList<>(Arrays.asList(addressList.split(",")));
    }
}
